#pragma once
#include "UniformBufferObject.h"
#include "Material.h"

struct LightParams;
struct MaterialParams;
class Material;

class UboMaterial :
	public UniformBufferObject
{
	//int m_off_texOffset;
	//int m_off_lightIndex;
	//int m_off_material;
	//int m_off_lightParams;
public:
	enum uOffset{ uo_lightIndex = 0, uo_materialParams_ambient, uo_lightParams0_ambient, uo_lightParams1_ambient, uo_count };

	UboMaterial();
	~UboMaterial();

	virtual void QueryOffset(GLuint program) override;
	void SetMaterial(MaterialParams *mate, bool bind);
	void UseLight(int index, bool bind);
	void SetLight(int index, LightParams &light, bool bind);

protected:
	int m_offsets[uo_count];
	int m_lightParams_size;
};

